const Path = require("path")

const baseConfig = {
    entry: "./bin/Exports.js",
    output: {
        filename: "dream_rpc_browser_bundle.js",
        path: Path.resolve(__dirname, "bin"),
        library: "dream_rpc",
        libraryTarget: "window"
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                use: "babel-loader"
            }
        ]
    }
}
module.exports = [
    {
        ...baseConfig,
        output: {
            ...baseConfig.output,
            filename: "dream_rpc_browser.development.js"
        },
        mode: "development"
    },
    {
        ...baseConfig,
        output: {
            ...baseConfig.output,
            filename: "dream_rpc_browser.production.js"
        },
        mode: "production"
    }
]